import Request from '@/utils/request'
import type { WordInfo } from '@/types/word'

/**
 * 获取敏感词数据
 */
export const getWordData = (params: any) => {
  return Request.get<WordInfo[]>('/admin/getwords', {
    params
  })
}

/**
 * 添加敏感词
 */
export const addWord = (data: WordInfo) => {
  return Request.post<null>('/admin/addwords', data)
}

/**
 * 修改敏感词
 */
export const updateWord = (data: WordInfo) => {
  return Request.put<null>('/admin/updatewords', data)
}

/**
 * 删除敏感词
 */
export const delWord = (id: number) => {
  return Request.delete<null>(`/admin/delwords/${id}`)
}
